package com.songlanyun.modules.shop.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.modules.account.entity.AccountEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 商家与管理帐户的关系表（一个商家可以建多个管理帐户,并分别给帐户权限）
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-04 16:06:34
 */
@Data
@TableName("yxt_shop_admin_relation")
public class ShopAdminRelationEntity extends RootEntity<Long, AccountEntity> implements Serializable {
    private static final long serialVersionUID = 1L;

    public ShopAdminRelationEntity() {
    }


    public ShopAdminRelationEntity(Long shopId, Long adminId) {
        this.shopId = shopId;
        this.adminId = adminId;
    }


    public ShopAdminRelationEntity(Long shopId, Long adminId, boolean primared) {
        this.shopId = shopId;
        this.adminId = adminId;
        this.primared = primared;
    }

    /**
     *
     */
    @TableId
    private Long id;
    /**
     * 商家id
     */
    private Long shopId;
    /**
     * 绑定的管理员帐号
     */
    private Long adminId;
    /**
     * 是否是店铺的主帐号
     */
    private boolean primared;
    /**
     * 绑定的时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @Override
    public Long getIdentity() {
        return id;
    }

}
